import random
from xml.dom.minidom import Element
# create Fu Word array
FuList = ['爱国福', '富强福', '和谐福', '友善福', '敬业福']
initCount = [0, 0, 0, 0, 0]
# create Fu word dictionary
FuCollection = dict(zip(FuList, initCount))
# print(FuCollection)

def beginCreate():
   return createFuRandomly()

def hasDone():
  total = 0
  for key, value in FuCollection.items():
    if value > 0: 
      total = total + 1
  # print('total', total)
  return total >=5

def createFuRandomly():
  num = random.randint(1,5)
  key = FuList[num-1]
  print('获取到：' + key)
  FuCollection[key] =  FuCollection[key] + 1
  return printFuCollection()

def printFuCollection():
  result = ''
  splitStr = '     '
  for key, value in FuCollection.items():
    currentItem = key + ": " + str(value)
    if result == '':
      result = currentItem
    else:
      result =  result + splitStr + currentItem
  print('当前拥有的福: ')
  print(result + '\n')
  return hasDone()